package com.demo.controller;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.demo.domain.SysUserLog;
import com.demo.model.R;
import com.demo.service.SysUserLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sysUserLog")
public class SysUserLogController {


    @Autowired
    private SysUserLogService sysUserLogService;
    /**
     * 分页查询用户的操作记录
     * 涉及表: sys_user_log
     * @param page
     * @return
     */
    @GetMapping
    public R<Page<SysUserLog>> findByPage(Page<SysUserLog> page){
        page.addOrder(OrderItem.desc("created"));
        return R.ok( sysUserLogService.page(page));
    }
}
